﻿#ifndef GLCAMERA_H
#define GLCAMERA_H

#include "eigen.h"
#include <GL/glut.h>
#include <iostream>

using namespace Eigen;
class GLCamera
{
public:
   GLCamera();
   GLCamera(const Vector3d& pos, const Vector3d& target, const Vector3d& up);
   void setModelViewMatrix();
   void setShape(float viewAngle,float aspect,float Near,float Far);
   void slide(float du, float dv, float dn);
   void roll(float angle);
   void yaw(float angle);
   void pitch(float angle);
   float getDist();
   Vector3d get_pos();
   bool validate();

private:
   Vector3d m_pos;
   Vector3d m_target;
   Vector3d m_up;
   Vector3d u,v,n;
   //修改，碰撞检测
   bool u_err, v_err, n_err;
};
#endif // GLCAMERA_H
